package day2.test;

import day2.dao.UserDaoAnnotation;
import day2.entity.User;
import org.apache.ibatis.session.SqlSession;
import org.junit.Test;
import util.Util;

public class Demo3 {
    @Test
    public void demo3(){
        SqlSession session=Util.getSession();
        UserDaoAnnotation dao= session.getMapper(UserDaoAnnotation.class);
        //System.out.println(dao.selectUById2(1));
        User u=new User();
        u.setName("hello1");
        u.setPass("123");
        dao.insertUser(u);

        session.commit();
        Util.closeSession(session);
    }
}
